<template>
	<view class="headnav">
		<view class="navber">
			<view class="statebar" :style="{height:statusbar+'px'}">

			</view>
			<view class="titlebar" :style="{height:titlebar + 'px'}">
				<view class="title">
				{{title}}
				</view>
				<view class="search">
					<uni-icons type="search" color="#888"></uni-icons>
					<text class="text">搜索</text>
				</view>
			</view>
		</view>
		<view class="fill" :style="{height:navber+ 'px'}">

		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		getstatusbar,
		gettitlebar,
		getnavber
	} from '@/utils/system.js'
	const statusbar = getstatusbar()
	const titlebar = gettitlebar()
	const navber = getnavber()
	defineProps({
		title:{
			type:String,
			default:''
		}
	})
</script>

<style lang="scss" scoped>
	.headnav {
		.navber {
			position: fixed;
			top: 0;
			left: 0;
			z-index: 10;
			width: 100%;
			background:
				linear-gradient(to bottom, transparent, #fff 400rpx),
				linear-gradient(to right, #beecd8 20%, #f4e2d8);

			.statebar {}

			.titlebar {
				display: flex;
				padding: 0 30rpx;

				.title {
					font-size: 40rpx;
					font-weight: 700;
					color: #000;
				}

				.search {
					width: 220rpx;
					height: 56rpx;
					border-radius: 60rpx;
					background: rgba(255, 255, 255, .4);
					border: 1px solid #fff;
					margin-left: 30rpx;
					color: #999;
					font-size: 28rpx;
					display: flex;
					align-items: center;
					padding-left: 10rpx;

					.text {
						padding-left: 10rpx;
					}
				}
			}
		}

		.fill {}
	}
</style>